package com.lxg.aop;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author 陆小根
 * date: 2022/04/25
 * Description:
 */
@Component
@Aspect
public class MyAdvice {

//  @Pointcut("execution(void com.lxg.dao.BookDao.update())")
//  @Pointcut("execution(void com.lxg.dao.impl.BookDaoImpl.update())")
//  @Pointcut("execution(* com.lxg.dao.impl.BookDaoImpl.update(*))") NO
//  @Pointcut("execution(void com.*.*.*.update())")
//  @Pointcut("execution(* *..*(..))")
//  @Pointcut("execution(* *..*e(..))")
//  @Pointcut("execution(void com..*())")
//  @Pointcut("execution(* com.lxg.*.*Service.find*(..))")
  @Pointcut("execution(* com.lxg.*.*Service.save(..))")
  private void pt() {}

  @Before("pt()")
  public void method() {
    System.out.println(System.currentTimeMillis());
  }

}
